﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Print.aspx.cs" Inherits="CanDoo.Oil.WebApp.buyInStore.Print" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>采购入库单打印</title>
    <script language="javascript" src="/PrintControl/LodopFuncs.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <p><a href="javascript:PreviewMytable();">打印预览</a></p>
        </div>
        <div id="div1">
            <div style="line-height: 30px" class="size16" align="center"><strong>浙 江 塔 石 集 团<br>采 购 入 库 单</strong></div>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td width="50%">采购单号：<%=entity.Code %>
                        </td>
                        <td width="50%">采购仓库：<%=entity.Warehouse.Name %>
                        </td>
                    </tr>
                    <tr>
                        <td>供应商：<%=entity.Supplier.ShortName %>

                        </td>
                        <td>约定付款：<%=CanDoo.Extensions.ObjectExtensions.TimeToStringDate(entity.AppointPayDate) %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="div2">
            <table border="1" cellspacing="0" cellpadding="1" width="100%" style="border-collapse: collapse" bordercolor="#333333">
                <thead>
                    <tr>
                        <td width="10%">
                            <div align="center"><b>编号</b></div>
                        </td>
                        <td width="20%">
                            <div align="center"><b>品名</b></div>
                        </td>
                        <td width="20%">
                            <div align="center"><b>型号/规格</b></div>
                        </td>
                        <td width="10%">
                            <div align="center"><b>单位</b></div>
                        </td>
                        <td width="10%">
                            <div align="center"><b>数量</b></div>
                        </td>
                        <td width="10%">
                            <div align="center"><b>单价</b></div>
                        </td>
                        <td width="20%">
                            <div align="center"><b>金额</b></div>
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <%
                        foreach (var m in entityDetails)
                        {
                    %>
                    <tr>
                        <td><%=m.Product.Code%></td>
                        <td><%=m.Product.Name%></td>
                        <td><%=m.Product.Model+"&nbsp;"+m.Product.Specifications%></td>
                        <td><%=productUnits.FirstOrDefault(p=>p.Id==m.Product.ProductUnitId).Name%></td>
                        <td><%=m.Num%></td>
                        <td><%=m.Price%></td>
                        <td><%=m.Money%></td>
                    </tr> 
                    <%
                        }
                    %>
                </tbody>
                <tfoot>
                    <tr>
                        <td><b>本页合计</b></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td tdata="pageNO" format="#" align="left">
                            <p align="center"><b>第#页</b></p>
                        </td>
                        <td tdata="pageCount" format="#" align="left">
                            <p align="center"><b>总##页</b></p>
                        </td>
                        <td tdata="subSum" format="#,##0.00" align="right">###</td>
                    </tr>
                </tfoot>
            </table>
        </div>
        <div id="div3">
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td width="25%">入库：<%=entity.User.Name %>
                        </td>
                        <td width="25%">入库日期：<%=CanDoo.Extensions.ObjectExtensions.TimeToStringDate(entity.InStoreDate) %>
                        </td>
                        <td width="25%">审核：<%=entity.PassAutitedUserId %>
                        </td>
                        <td width="25%">审核日期：<%=CanDoo.Extensions.ObjectExtensions.TimeToStringDate(entity.PassAutitedTime) %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </form>
    <script>
        function PreviewMytable() {
            var LODOP = getLodop();

            LODOP.PRINT_INIT("采购入库单<%=entity.Code%>");
            LODOP.SET_PRINT_PAGESIZE(1, 2410, 930, "");
            var strStyle = "<style> table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>"
            LODOP.ADD_PRINT_TABLE(122, "5%", "90%", 320, strStyle + document.getElementById("div2").innerHTML);
            LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
            LODOP.ADD_PRINT_HTM(26, "5%", "90%", 109, document.getElementById("div1").innerHTML);
            LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
            LODOP.ADD_PRINT_HTM(444, "5%", "90%", 54, document.getElementById("div3").innerHTML);
            LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
            LODOP.ADD_PRINT_BARCODE(15, 15, 307, 47, "128A", "<%=entity.Code%>");
            //LODOP.NewPageA();
            //LODOP.ADD_PRINT_TABLE(128, "5%", "90%", 328, strStyle + document.getElementById("div2").innerHTML);
            //LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
            //LODOP.ADD_PRINT_HTM(26, "5%", "90%", 80, document.getElementById("div4").innerHTML);
            //LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            //LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 4);
            //LODOP.ADD_PRINT_TEXT(460, 96, "76.25%", 20, "真诚祝您好远，欢迎下次再来！(发货单02的表格外“页脚”，紧跟表格)");
            //LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 4);
            //LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            //LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FF0000");
            //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            //LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            //LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
            //LODOP.ADD_PRINT_HTM(1, 600, 300, 100, "总页号：<font color='#0000ff' format='ChineseNum'><span tdata='pageNO'>第##页</span>/<span tdata='pageCount'>共##页</span></font>");

            //LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);

            //LODOP.SET_PRINT_STYLEA(0, "Horient", 1);
            //LODOP.ADD_PRINT_TEXT(3, 34, 196, 20, "总页眉：《两个发货单的演示》");
            //LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
            LODOP.PREVIEW();
        };
    </script>
</body>
</html>
